package com.xdpdp.smile.user.controller.vo;

import com.xdpdp.smile.utils.common.vo.BaseRequestVO;
import com.xdpdp.smile.utils.exception.CommonServiceException;
import com.xdpdp.smile.utils.util.ToolUtils;
import lombok.Data;

/**
 * 登录请求对象
 *
 * @author Herman
 */
@Data
public class LoginReqVO extends BaseRequestVO {

    private String username;
    private String password;

    @Override
    public void checkParam() throws CommonServiceException {
        //验证数据合法性
        if (ToolUtils.strIsNull(username) || ToolUtils.strIsNull(password)) {
            throw new CommonServiceException(404, "账号或密码不能为空");
        }
    }
}
